var evalRPN = function (tokens) {
  let stack = [];
  let options = {
    "+": (a, b) => a + b,
    "-": (a, b) => a - b,
    "*": (a, b) => a * b,
    "/": (a, b) => (a / b) | 0, // 会将小数部分去掉，只保留整数部分 Math.trunc()
  };

  for (const token of tokens) {
    if (token in options) {
      let b = stack.pop();
      let a = stack.pop();
      stack.push(options[token](a, b));
    } else {
      stack.push(Number(token));
    }
  }
  return stack[0];
};